<template>
    <div class="singer-intro">
        <div>
            <h2>简介</h2>
            <div>{{ briefDesc }}</div>
        </div>
        <div>
            <h2>基本资料</h2>
            <div>
                <div v-for="(item, index) in introduction" :key="index">
                    <span>{{ item.ti }}:</span>
                    <span style="white-space: pre-wrap">{{ item.txt }} </span>
                </div>
            </div>
        </div>
        <!-- <div v-for="(item, index) in otherItem" :key="index">
            <h2>{{ item.key }}</h2>
            <div style="white-space: pre-wrap">{{ item.value }}</div>
        </div> -->
    </div>
</template>

<script>
export default {
    props:["singerId"],  //propertys
    data(){
        return{
            briefDesc:"",//简介描述
            introduction:[],//基本资料
            //otherItem:[]//其他（从艺历程和荣誉记录）
        }
    },
    created(){
        this.getData()
    },
    methods:{
        getData(){
            this.$request('get','/artist/desc',{
                id:this.singerId
            })
            .then((res)=>{
                console.log(res)
                this.briefDesc = res.briefDesc
                this.introduction = res.introduction
                // this.otherItem = res.data.other.tiem
            })
        }
    }
}
</script>

<style scoped>
.singer-intro{
    text-align: left;
    padding: 0 1rem;
}
</style>